Update to rust master
authorAlex Crichton <alex@alexcrichton.com>
Fri, 2 Jan 2015 21:39:30 +0000 (13:39 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 2 Jan 2015 21:39:30 +0000 (13:39 -0800)
12 files changed:
.travis.install.deps.sh
Cargo.lock
Cargo.toml
src/bin/cargo.rs
src/cargo/core/resolver/encode.rs
src/cargo/lib.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/mod.rs
src/cargo/ops/registry.rs
src/cargo/sources/git/utils.rs
src/cargo/util/lev_distance.rs
src/rustversion.txt

index 9f0b9c281435df30ac60601524402eff2d0ad7d4..d75a71c2699ede6ea54f9e74df127d8ff2102d30 100755 (executable)
@@ -42,8 +42,8 @@ if [ -z "${windows}" ]; then
     cp -r rust-nightly-$src-$target/lib/rustlib/$src-$target \
           rust-nightly-$dst-$target/lib/rustlib
     (cd rust-nightly-$dst-$target && \
-     find lib/rustlib/$src-$target/lib -type f >> \
-     lib/rustlib/manifest.in)
+     find lib/rustlib/$src-$target/lib -type f | sed 's/^/file:/' >> \
+     manifest-rustc.in)
 
     ./rust-nightly-$dst-$target/install.sh --prefix=rustc
     rm -rf rust-nightly-$src-$target
index 6e294eb3c9f13bbc3b8f18f8de64ebacd147552f..d8b7a806664af08f32035f8696c8ef3499a81a6f 100644 (file)
@@ -3,9 +3,9 @@ name = "cargo"
 version = "0.1.0"
 dependencies = [
  "curl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)",
  "flate2 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "glob 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)",
  "log 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -34,16 +34,16 @@ version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "docopt"
-version = "0.6.20"
+version = "0.6.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "regex 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -62,7 +62,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "git2"
-version = "0.1.4"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libgit2-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -86,7 +86,7 @@ version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libssh2-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -104,7 +104,7 @@ version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -121,7 +121,7 @@ name = "log"
 version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "regex 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -134,7 +134,7 @@ dependencies = [
 
 [[package]]
 name = "openssl-sys"
-version = "0.2.9"
+version = "0.2.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libressl-pnacl-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -153,7 +153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "regex"
-version = "0.1.4"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
index 922b32b666a03b975b8938ec205f11f3daf17785..4587eecb30b00dd70e1fa925e5613ffbe1eb1e86 100644 (file)
@@ -42,6 +42,9 @@ doc = false
 
 [[test]]
 name = "tests"
+[[bench]]
+name = "tests"
+path = "tests/tests.rs"
 
 [[test]]
 name = "resolve"
index 7d05e9ccbe3cbf9de3ba9871142d7d8766ab10b2..95a160fd85e3419f93b2f7015789a1dfba2f40a5 100644 (file)
@@ -1,5 +1,4 @@
 #![feature(phase, macro_rules)]
-#![deny(warnings)]
 
 extern crate "rustc-serialize" as rustc_serialize;
 #[phase(plugin, link)] extern crate log;
index d9f0760845ed156c9987ecf74656b552065451aa..a469ed2b2f3dc0f32acfbe0efd0850ac1e646714 100644 (file)
@@ -26,7 +26,7 @@ impl EncodableResolve {
         let packages = self.package.as_ref().unwrap_or(&packages);
 
         {
-            let register_pkg = |pkg: &EncodableDependency| {
+            let register_pkg = |pkg: &EncodableDependency| -> CargoResult<()> {
                 let pkgid = try!(pkg.to_package_id(default));
                 let precise = pkgid.get_source_id().get_precise()
                                    .map(|s| s.to_string());
@@ -43,7 +43,7 @@ impl EncodableResolve {
         }
 
         {
-            let add_dependencies = |pkg: &EncodableDependency| {
+            let add_dependencies = |pkg: &EncodableDependency| -> CargoResult<()> {
                 let package_id = try!(pkg.to_package_id(default));
 
                 let deps = match pkg.dependencies {
index 9a6768500c96e7470efdb90560367c71839be768..d20f5dcf287d9b9a3480bab8a619e90cbbc336e4 100644 (file)
@@ -2,6 +2,7 @@
 #![crate_type="rlib"]
 
 #![feature(macro_rules, phase, default_type_params, unboxed_closures)]
+#![feature(slicing_syntax)]
 #![deny(unused)]
 #![cfg_attr(test, deny(warnings))]
 
index f34fb26fd2c00c5971749df1f6cfc64c288c41de..08d5f0429d3edcb0951328bce6b925e0ca14467f 100644 (file)
@@ -106,7 +106,7 @@ pub fn prepare(pkg: &Package, target: &Target, req: Platform,
     //
     // Note that this has to do some extra work just before running the command
     // to determine extra environment variables and such.
-    let work = move |: desc_tx: Sender<String>| {
+    let work = move |: desc_tx: Sender<String>| -> CargoResult<()> {
         // Make sure that OUT_DIR exists.
         //
         // If we have an old build directory, then just move it into place,
@@ -122,7 +122,7 @@ pub fn prepare(pkg: &Package, target: &Target, req: Platform,
         // along to this custom build command.
         let mut p = p;
         {
-            let build_state = build_state.outputs.lock();
+            let build_state = build_state.outputs.lock().unwrap();
             for &(ref name, ref id) in lib_deps.iter() {
                 let data = &build_state[(id.clone(), kind)].metadata;
                 for &(ref key, ref value) in data.iter() {
@@ -226,7 +226,7 @@ impl BuildState {
 
     fn insert(&self, id: PackageId, req: Platform,
               output: BuildOutput) {
-        let mut outputs = self.outputs.lock();
+        let mut outputs = self.outputs.lock().unwrap();
         match req {
             Platform::Target => { outputs.insert((id, Kind::Target), output); }
             Platform::Plugin => { outputs.insert((id, Kind::Host), output); }
index b31d77d2019c837a757725e8e5a868d8f9f344f4..f563f1e28dd76336dd08ee380d136e57b5ac32b2 100644 (file)
@@ -178,7 +178,7 @@ pub fn compile_targets<'a>(env: &str, targets: &[&'a Target], pkg: &'a Package,
     let out_dir = cx.layout(pkg, Kind::Target).build_out(pkg)
                     .display().to_string();
     cx.compilation.extra_env.insert("OUT_DIR".to_string(), Some(out_dir));
-    for (&(ref pkg, _), output) in cx.build_state.outputs.lock().iter() {
+    for (&(ref pkg, _), output) in cx.build_state.outputs.lock().unwrap().iter() {
         let any_dylib = output.library_links.iter().any(|l| {
             !l.ends_with(":static") && !l.ends_with(":framework")
         });
@@ -290,7 +290,7 @@ fn compile<'a, 'b>(targets: &[&'a Target], pkg: &'a Package,
             let kind = match req { Platform::Plugin => Kind::Host, _ => Kind::Target };
             let key = (pkg.get_package_id().clone(), kind);
             if pkg.get_manifest().get_links().is_some() &&
-                cx.build_state.outputs.lock().contains_key(&key) {
+                cx.build_state.outputs.lock().unwrap().contains_key(&key) {
                     continue
                 }
             let (dirty, fresh, freshness) =
@@ -481,7 +481,7 @@ fn rustc(package: &Package, target: &Target,
             // Only at runtime have we discovered what the extra -L and -l
             // arguments are for native libraries, so we process those here.
             {
-                let build_state = build_state.outputs.lock();
+                let build_state = build_state.outputs.lock().unwrap();
                 for id in native_lib_deps.into_iter() {
                     let output = &build_state[(id.clone(), kind)];
                     for path in output.library_paths.iter() {
index e793a06ca4f0c90ed6b117530a89731d4524c6b1..b76415d570266d03888b1f801e2d89b541c2bc32 100644 (file)
@@ -1,12 +1,13 @@
 use std::collections::HashMap;
 use std::io::File;
 use std::io::fs::PathExtensions;
+use std::iter::repeat;
 use std::os;
-use term::color::BLACK;
 
 use curl::http;
 use git2;
 use registry::{Registry, NewCrate, NewCrateDependency};
+use term::color::BLACK;
 
 use core::source::Source;
 use core::{Package, MultiShell, SourceId};
@@ -371,9 +372,8 @@ pub fn search(query: &str, shell: &mut MultiShell, index: Option<String>) -> Car
     for (name, description) in list_items.into_iter() {
         let line = match description {
             Some(desc) => {
-                let space = String::from_char(
-                    description_margin - name.len(),
-                    ' ');
+                let space = repeat(' ').take(description_margin - name.len())
+                                       .collect::<String>();
                 name.to_string() + space.as_slice() + desc.as_slice()
             }
             None => name
index 33a0e06ba67fb9f9b8e81996a87ddd8df45d5edf..1f6c0aed89b38b902f4926fc96cf00ce5c3b0c3a 100644 (file)
@@ -366,6 +366,7 @@ fn with_authentication<T>(url: &str,
     cred_helper.config(cfg);
     let mut cred_error = false;
     let ret = f(&mut |&mut: url, username, allowed| {
+        let username = if username.is_empty() {None} else {Some(username)};
         let creds = if allowed.contains(git2::SSH_KEY) {
             let user = username.map(|s| s.to_string())
                                .or_else(|| cred_helper.username.clone())
index 24e9883744407b9ebb698e2caa6f4f6a8278cdda..d37a227915f7c1e66e785b91eae7a6a4f6126677 100644 (file)
@@ -14,7 +14,7 @@ pub fn lev_distance(me: &str, t: &str) -> uint {
     if me.is_empty() { return t.chars().count(); }
     if t.is_empty() { return me.chars().count(); }
 
-    let mut dcol = Vec::from_fn(t.len() + 1, |x| x);
+    let mut dcol = range(0, t.len() + 1).collect::<Vec<_>>();
     let mut t_last = 0;
 
     for (i, sc) in me.chars().enumerate() {
@@ -47,7 +47,7 @@ fn test_lev_distance() {
     // Test bytelength agnosticity
     for c in range(0u32, MAX as u32)
              .filter_map(|i| from_u32(i))
-             .map(|i| String::from_char(1, i)) {
+             .map(|i| i.to_string()) {
         assert_eq!(lev_distance(c[], c[]), 0);
     }
 
index 8cbc9fc6e97408f35d17c225e34d0ce66371e7e5..128b79ec59bd704540a1e0ea7ba96431cb9bd2c8 100644 (file)
@@ -1 +1 @@
-2014-12-30
+2015-01-02